home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.arch.arithmetic,comp.lang.c,comp.lang.c++
- Path: Utrecht.NL.net!news
- From: Franz Korntner <fkorntne@bazis.nl>
- Subject: Re: Access carry flag from C
- X-Nntp-Posting-Host: bastion1.bazis.nl
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <312D850C.2781@bazis.nl>
- Sender: news@inter.NL.net (News at newsutr)
- Content-Transfer-Encoding: 7bit
- Organization: NLnet
- References: <Dn1C9z.DGv.0.net@indra.com> <1996Feb1922.17.19.879@koobera.math.uic.edu> <31298D20.41C6@bazis.nl> <danpop.824859220@rscernix> <312AFACE.41C6@bazis.nl> <824997378snz@genesis.demon.co.uk>
- Mime-Version: 1.0
- Date: Fri, 23 Feb 1996 09:12:44 GMT
- X-Mailer: Mozilla 2.0 (X11; I; OSF1 V3.2 alpha)
-
- Lawrence Kirby wrote:
-
- > There is no guarantee that a particular implementations supports a 32 bit
- > type. Whatever type you use you have to use the relevant limits for that
- > type.
-
- True.
-
- >
- > >According to the (X3J11 / ANSI) standard, the constant
- > >INT_MAX (and in this case most limits in limits.h) denotes the minimal
- > >limit. It is possible that the physical limit is much higher (or lower
- > >in the case of negative values).
- >
- > No. The value defined for INT_MAX in limits.h is the maximum value an int
- > can hold *on that particular implementation*. The standard requires that
- > INT_MAX be at least 32767 on all implementations (but it can be and
- > often is higher). So on any implementation:
- >
- > int x = INT_MAX+1;
- >
- > is a guaranteed overflow.
-
- Wrong. The limits are minima. The above operation does not have to overflow!
-
- > >and what I really miss in the
- > >standard and/or implementation is a inline function 'maxlimitof(int)',
- > >analogical to 'sizeof(int)'.
- >
- > That is precisely what INT_MAX gives you.
-
- INT_MAX is a constant. On some platforms you can force GCC to assume int's
- to be 16 bit values. What about INT_MAX then?!?
-
- --
- +-----------------------------------------------------------------------+
- | Franz Korntner at BAZIS, dept. System Development, Leiden, Netherlands|
- | E-mail: fkorntne@hiscom.nl |
- +-----------------------------------------------------------------------+
-